import KrpanoUtil from './KrpanoUtil';
import {Hotspot,ElementType} from './Types'

export default class KrpanoOprateUtil {

    private readonly krpanoUtil: KrpanoUtil;

    constructor(krpanoInstance:any){
        this.krpanoUtil = new KrpanoUtil(krpanoInstance)
    }

    insertHotspot(hotspot:Hotspot):void{
        this.krpanoUtil.insertElement('hotspot',hotspot)
    }

    setHotspot(hotspot:Hotspot):void{
        this.krpanoUtil.setElement('hotspot',hotspot)
    }

    removeHotspot(hotspot:Hotspot):void{
        this.krpanoUtil.removeElement('hotspot',hotspot.name)
    }

    getHotspots(hotspotName?:string):Hotspot[]{
        return this.krpanoUtil.getElements<Hotspot>('hotspot',hotspotName);
     }

    getHotspot(hotspotName:string):Hotspot|null{
       return this.krpanoUtil.getElement<Hotspot>('hotspot',hotspotName);
    }

}